Skip to content

feat: unify annotation system to server-backed review API - #16

Merged
surenny merged 4 commits into
surenny:mainfrom
Camille1024:feat/unify-annotation-system
May 7, 2026
Merged

feat: unify annotation system to server-backed review API#16
surenny merged 4 commits into
surenny:mainfrom
Camille1024:feat/unify-annotation-system

Conversation

@Camille1024

Copy link
Copy Markdown
Collaborator

Summary

  • 统一批注系统 (Closes 统一两套批注系统:段落批注与节点审阅应合并 #15):将章节页面的 localStorage 批注替换为服务端 review API,评论持久化到 status.yaml,多人可见,章节页与依赖图共享同一数据源
  • 重写 annotations.js(~580→200 行):通过 GET /api/status 获取评论、POST /api/review 提交评论,扫描 _thmwrapper 元素显示指示器
  • 精简 annotations.css(~345→200 行):移除编辑/解决/工具栏样式,新增 topic 选择器和反馈消息样式
  • 修复 dep_graph 重复标签 bugupdateButtons() 改用 .completion-label 类选择器替代不可靠的内联 style 属性匹配,解决每次 Send 后 "Complete (definition)" 重复叠加的问题
  • 新增 Docker 部署配置:Dockerfile(多阶段构建)、docker-compose.yml、.dockerignore
  • 新增项目主页homepage/index.html

Test plan

  • docker compose up -d --build 构建并启动容器
  • 打开章节页面(如 sec-prereq.html),确认定理旁有 ✍ 指示器
  • 点击指示器,查看已有评论(来自 status.yaml)
  • 提交新评论,确认 status.yaml 更新
  • 打开依赖图页面,确认同一节点显示相同评论
  • 在依赖图页面发送评论,确认 "Complete (definition)" 不再重复
  • 换浏览器/无痕窗口打开,确认能看到其他人的评论

🤖 Generated with Claude Code

chorewer and others added 3 commits April 27, 2026 16:49
…y#15)

Replace the localStorage-based annotation system with the existing
server-backed review API so comments persist in status.yaml and are
visible to all users across both chapter pages and the dependency graph.

- Rewrite annotations.js (~580→200 lines): fetch from GET /api/status,
  post via POST /api/review, scan _thmwrapper elements for indicators
- Simplify annotations.css (~345→200 lines): remove edit/resolve/toolbar
  styles, add topic selector and feedback message styles
- Fix "Complete (definition)" duplication bug in dep_graph: use
  .completion-label class selector instead of unreliable inline style
  attribute matching
- Add Docker deployment: Dockerfile (multi-stage build), docker-compose,
  .dockerignore
- Add project homepage (homepage/index.html)

Closes surenny#15

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@surenny
surenny merged commit debbcf5 into surenny:main May 7, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

统一两套批注系统:段落批注与节点审阅应合并

3 participants